/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testslu;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

/**
 *
 * @author Jose Carlos Palma
 */
public class TestSLU {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here

        System.out.println("Creando enlace de red");
        Socket s = new Socket("127.0.0.1", 60001);
        BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
        PrintWriter pw = new PrintWriter(s.getOutputStream(), true);

        String[] t = {
            "T1 99436878 188.0 0.00 0.00 0.00 ;",
            "T11 98866255;",
            "T12 98866255;",
            "T15 99034990;",
            "T20 99768243 PROMO_10x200;",
            "T20 98567082 NEAR_PROMO_10x200;",
            "T21 98473974;",
            "T21 98485797;",
            "T3 99806160 313.0;",
            "T30 98442521;",
            "T4 98541411 1702 82.22 50 0;",
            "T8 98889749 0 0 0 0;"
        };
        
        for(int i = 0; i < t.length*200; i++){
            int indx = i % t.length;
            for(int j = 0; j < t[indx].length(); j++){
                s.getOutputStream().write(t[indx].charAt(j));
                s.getOutputStream().flush();
                System.out.print(t[indx].charAt(j));
            }
            System.out.println();
        }
        s.close();

    }
}
